<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>新建积分规则</title>
		<%@include file="../collect/meta.jsp"%>
		<link rel="stylesheet" href="${ctx }/css/radius.css" type="text/css"></link>
		<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
		<script type="text/javascript" charset="utf-8" src="${ctx }/calender/WdatePicker.js"></script>
		<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
	</head>
	<body lang="zh-cn">
		<div class="wrapper">
			<c:import url="/collect/top.jsp"></c:import>
			<div class="main-container" id="main-container">
				<div class="main-container-inner">
					<c:import url="/collect/left.jsp"></c:import>
					<div class="main-content">
						<div class="breadcrumbs" id="breadcrumbs">
							<ul class="breadcrumb">
								<li><i class="icon-home home-icon"></i>积分管理</li>
								<li>积分规则</li>
								<li>时间段规则</li>
								<li>新增时间段积分规则</li>
							</ul>
						</div>
						<div class="page-content">
							<div class="row">
								<div class="col-xs-12">
									<div class="tabbable">
										<ul class="nav nav-tabs" id="myTab">
											<li><a href="integralrule!watchEnterpriseIntegralRule">积分等级</a></li>
											<li><a href="bGiveRule!entrygiveValue">注册时积分规则</a></li>
											<li class="active"><a href="bGiveRule!watchBgiveRule">时间段规则</a></li>
										</ul>
									</div>
									<form action="bGiveRule!saveBgiveRule" name="addRule"method="post" >
										<table width="100%" border="0">
											<tr>
												<td height="40"><div align="right"><strong>活动名称:&nbsp;</strong></div></td>
												<td><input type="text" name="bGiveRule.name" class="input"></td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"><div align="right"><strong>开始时间:&nbsp;</strong></div></td>
												<td><input class="Wdate" type="text" name="bGiveRule.fromTime"onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly="readonly"></td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"><div align="right"><strong>结束时间:&nbsp;</strong></div></td>
												<td><input class="Wdate" type="text" name="bGiveRule.toTime"onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly="readonly"></td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"><div align="right"><strong>积分操作:&nbsp;</strong></div></td>
												<td><input type="text" class="input"name="bGiveRule.raiseValue" id="bRaiseValue" /></td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"><div align="right"><strong>奖励规则:&nbsp;</strong></div></td>
												<td>
													<select name="bGiveRule.type" class="input" id="three">
														<option value="3">积分增加</option>
														<option value="2">积分翻倍</option>
													</select>
												</td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"><div align="right"><strong>是否启用:&nbsp;</strong></div></td>
												<td>
													<select name="bGiveRule.state" class="input" id="three">
														<option value="1">启用</option>
														<option value="2">不启用</option>
													</select>
												</td>
												<td><div align="left" id="three"></div></td>
											</tr>
											<tr>
												<td height="40"></td>
												<td>
													<input type="button" class="btn btn-primary radius" id="but" value="添加" />
													<a class="btn btn-primary radius" href="bGiveRule!watchBgiveRule">返回</a>
												</td>
												<td></td>
											</tr>
										</table>
									</form>
									<div align="center" style="color: red;font-size: 20px;font-weight: bold;">
										<c:if test="${message!=null}">
											<lable>${message }</lable>
										</c:if>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<a href="#" id="btn-scroll-up"
					class="btn-scroll-up btn btn-sm btn-inverse"
					style="position: fixed; bottom: 0;"> <i
					class="icon-double-angle-up icon-only bigger-110"></i> </a>
			</div>
			<div class="push"></div>
		</div>
		<c:import url="/collect/down.jsp"></c:import>
		<script type="text/javascript">
			$('#bRaiseValue')
					.blur(
							function() {
								var bRaiseValue = $('#bRaiseValue').val();
								if (!/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/
										.test(bRaiseValue)) {
									alert('操做积分填写有误');
								}
		
							});
			$('#but')
					.click(
							function() {
								var bRaiseValue = $('#bRaiseValue').val();
								if (!/^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/
										.test(bRaiseValue)) {
									alert('操做积分填写有误');
								}else{
								addRule.submit();
								}
							});
		 		//防收回；$积分规则
				$('.jifenguanli > ul').show();
				$('.jifenguanli > ul > li > a').eq(0).css("color","red");     
		</script>
	</body>
</html>